%% fileSearchValidation
% Validates arguments to be passed into getFilePath
%
%% Syntax
% [ ] = fileSearchValidation( extensionSearch, fileType )
%
% [ ] = fileSearchValidation( '*.oct', 'oct' )
%
% [ ] = fileSearchValidation( '*.mat', 'colormap' )
%
%% Description
% This function validates arguments to be passed into getFilePath.
% extensionSearch must be in the following format: '*.[3 letters]', and 
% fileType must be of class character.
%
%% Arguments
%* extensionSearch       - Char: An expression specifying the extension of 
%                                the filetype of interest to be searched for
%
%* fileType              - Char: A description of the filetype of interest
%                               (oct, dicom, colormap etc)
%
%% Returns
%* N/A
%
%% Function Side Effects
% * N/A
%
%% Exceptions
%* An error is thrown if the user fails to select a file of interest
%
%% See Also
% getFilePath
%
function [ ] = fileSearchValidation( extensionSearch, fileType )

% Validates input class
iP = inputParser;
iP.addRequired('fileType', @ischar);
iP.parse(fileType);

% Validates that extensionSearch is the proper format for a file extension
% search (*.[1-3 letters])
extensionValidation = '^.*\.[a-zA-Z]{1,4}$';

if isempty(regexpi(extensionSearch, extensionValidation)) == 1
    
    error('getFilePath:ImproperFileExtensionExpression', ...
          '%s is not a valid string for searching for files of a certain extension (*.[4 letters])', ...
          extensionSearch);
end 


end

